#include <iostream>
using namespace std;

const int N = 100010;
int a[N], b[N];
int n, m;

int main()
{
    scanf("%d%d", &n, &m);
    for (int i = 1; i <= n; ++i)
    {
        scanf("%d", a + i);
        b[i] = a[i] - a[i - 1];
    }
    while (m--)
    {
        int l, r, c;
        scanf("%d%d%d", &l, &r, &c);
        b[l] += c;
        b[r + 1] -= c;
    }
    for (int i = 1; i <= n; ++i)
        printf("%d ", a[i] = a[i - 1] + b[i]);
    return 0;
}